service=jQuery.noConflict();
 service().ready(function() {
					
                    service("#service-registration-node-form").validate({
													  


// Title Validation
  rules: {
						'field_department[und]': { 
							required: true,
							maxlength: 255,
							chkbadchar:true,
							valuenotequals: '_none',
						},
						'field_src_org[und]': { 
							required: true,
							maxlength: 255,
							chkbadchar:true,
							valuenotequals: '_none',
						},
						'field_src_dist[und][]':{
							multi_dist_select: true,
							
							},
						'title': { 
							required: true,
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,
							splchar:true,
						},
						'field_src_cate[und]':{
							required:true,
							valuenotequals:'_none',
							
							},
        
    					'field_web_othercategory[und][0][value]':{
							required: true,
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,							
							},
						
						
						'field_src_type[und]': { 
							required: true,
							maxlength: 200,
							chkbadchar:true,
						},
						'field_service_associate[und]':{
								//minlength: 5,
							maxlength: 255,
							chkbadchar:true,
						},
						'field_src_website[und][0][value]':{
							required: "#field-src-type-und-online:checked",
							url: true,
							chkbadchar:true,
						},
						'files[field_src_upload_und_0]':{
							required: "#edit-field-src-type-und-download:checked",
							chkfile_format_size: true,
						},
						'field_src_keyword[und][0][value]':{
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,
							splchar:true,							
						},
						'field_scr_desc[und][0][value]':{
							required: true,
							minlength: 5,
							maxlength: 500,
							chkbadchar:true,
							splchar:true,							
							},
					
					},
            
messages: {
							'field_department[und]':{
							required: 'Please Select Concerned Department',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',
							valuenotequals: 'Please Select Concerned Department',
							},
							'field_src_org[und]':{
							required: 'Please Select Organization',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',	
							valuenotequals: 'Please Select Organisation Name',
							},
							'field_src_dist[und][]':{
							required: 'Please Select Districts',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',	
							multi_dist_select: 'Please Select either All or Particular Districts',
							},
							'title': { 
							required:  'Please enter Title',
							minlength: 'Minimum 5 characters should be entered',
							maxlength: 'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							splchar:'Special Characters are not allowed',
							},
							'field_src_cate[und]': {
							required: 'Please Select Service Category',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',	
							valuenotequals: 'Please Select Service Category',
							},
													  
							'field_web_othercategory[und][0][value]':{
							required:  'Field Value is Required',
							minlength: 'Minimum 5 characters should be entered',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',						
							},
							'field_service_associate[und]':{
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'Invalid Option.',
							},
							
							'field_src_type[und]': { 
							required: 'Please select documents available option',
							maxlength:  'Invalid option',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							},
							'field_src_website[und][0][value]':{
							required: "Please Enter URL",
							url: 'Not Valid URL',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							},
							'files[field_src_upload_und_0]':{
							required: 'Please select upload file',
							chkfile_format_size: 'Invalid File Format',
							},
							'field_src_keyword[und][0][value]':{

							minlength: 'Minimum 5 characters should be entered',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							splchar:'Special Characters are not allowed',					
							},
							'field_scr_desc[und][0][value]':{
							minlength: 'Minimum 5 characters should be entered',
							required:'Please enter Description',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							splchar:'Special Characters are not allowed',					
							},
							
							
							
	
				}, 
					//errorLabelContainer: "#errormsg_container",
					 //focusInvalid: false,
   					invalidHandler: function(form, validator) {
       
       					 if (!validator.numberOfInvalids())
								return;
						else{
							
							//  service("#service-registration-node-form").create_errormsg_container('errormsg_container','service-registration-node-form');
						}
							
							service('html, body').animate({
								scrollTop: service(validator.errorList[0].element).offset().top - 100
							}, 1000);
							
						},
				

   
	});




            
});

